/*
 *
 *  * Copyright (c) GoKeep by gokeep.org. 2022-2023. All rights reserved
 *
 */

package org.gokeep.common.mapper;


import java.util.List;

public interface BaseMapper<D, E> {
    /**
     * 转换为DTO
     * @param entity
     * @return
     */
    D toDto(E entity);

    /**
     * 转换为DTO LIST
     * @param entities
     * @return
     */
    List<D> toDto(List<E> entities);


    /**
     * 转换为实体
     * @param dto
     * @return
     */
    E toEntity(D dto);


    /**
     * 转换为Entity LIST
     * @param dto
     * @return
     */
    List<E> toEntity(List<D> dto);
}
